@@ -299,9 +299,7 @@ module LiquidInterpolatable |
||
299 | 299 |
end |
300 | 300 |
|
301 | 301 |
def render(context) |
302 |
- credential = context.registers[:agent].credential(@credential_name) |
|
303 |
- raise "No user credential named '#{@credential_name}' defined" if credential.nil? |
|
304 |
- credential |
|
302 |
+ context.registers[:agent].credential(@credential_name) |
|
305 | 303 |
end |
306 | 304 |
end |
307 | 305 |
|
@@ -91,10 +91,11 @@ shared_examples_for LiquidInterpolatable do |
||
91 | 91 |
expect(@checker.interpolate_string("{% credential aws_key %}", {})).to eq('2222222222-jane') |
92 | 92 |
end |
93 | 93 |
|
94 |
- it "should raise an exception for undefined credentials" do |
|
94 |
+ it "should not raise an exception for undefined credentials" do |
|
95 | 95 |
expect { |
96 |
- @checker.interpolate_string("{% credential unknown %}", {}) |
|
97 |
- }.to raise_error(/No user credential named/) |
|
96 |
+ result = @checker.interpolate_string("{% credential unknown %}", {}) |
|
97 |
+ expect(result).to eq('') |
|
98 |
+ }.not_to raise_error |
|
98 | 99 |
end |
99 | 100 |
end |
100 | 101 |
|